package service.impl;

import bean.User;
import dao.UserDao;
import org.springframework.dao.EmptyResultDataAccessException;
import service.UserService;

public class UserServiceImpl implements UserService {

    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public User login(User user) {
        try {
            userDao.login(user);
            return user;
        } catch (EmptyResultDataAccessException e) {
            return null;
        }
    }
}
